import request from '../../util/axios'

// 分页查询系统数据字典
export const getSysDic = (data) => request({
  url: '/yuyi-config-boot/api/config/dictType/paging',
  method: 'post',
  data
})

// 分页查询档案数据字典
export const getArchivesDic = (data) => request({
  url: '/yuyi-config-boot/api/config/arcDictType/paging',
  method: 'post',
  data
})

// 新增系统数据字典
export const addSysDic = (data) => request({
  url: '/yuyi-config-boot/api/config/dictType',
  method: 'post',
  data
})

// 新增档案数据字典
export const addArchivesDic = (data) => request({
  url: '/yuyi-config-boot/api/config/arcDictType',
  method: 'post',
  data
})

// 编辑系统数据字典
export const editSysDic = (data) => request({
  url: '/yuyi-config-boot/api/config/dictType',
  method: 'put',
  data
})

// 编辑档案数据字典
export const editArchivesDic = (data) => request({
  url: '/yuyi-config-boot/api/config/arcDictType',
  method: 'put',
  data
})

// 删除系统数据字典
export const delSysDic = (data) => request({
  url: '/yuyi-config-boot/api/config/dictType',
  method: 'delete',
  data
})

// 删除档案数据字典
export const delArchivesDic = (data) => request({
  url: '/yuyi-config-boot/api/config/arcDictType',
  method: 'delete',
  data
})

// 分页查询系统数据字典详情
export const getSysDicDetList = (data) => request({
  url: '/yuyi-config-boot/api/config/dictData/paging',
  method: 'post',
  data
})

// 分页查询档案数据字典详情
export const getArchivesDicDetList = (data) => request({
  url: '/yuyi-config-boot/api/config/arcDictData/paging',
  method: 'post',
  data
})

// 新增系统数据字典详情
export const addSysDicDetList = (data) => request({
  url: '/yuyi-config-boot/api/config/dictData',
  method: 'post',
  data
})

// 新增档案数据字典详情
export const addArchivesDicDetList = (data) => request({
  url: '/yuyi-config-boot/api/config/arcDictData',
  method: 'post',
  data
})

// 编辑系统数据字典详情
export const editSysDicDetList = (data) => request({
  url: '/yuyi-config-boot/api/config/dictData',
  method: 'put',
  data
})

// 编辑档案数据字典详情
export const editArchivesDicDetList = (data) => request({
  url: '/yuyi-config-boot/api/config/arcDictData',
  method: 'put',
  data
})

// 删除系统数据字典详情
export const delSysDicDetList = (data) => request({
  url: '/yuyi-config-boot/api/config/dictData',
  method: 'delete',
  data
})

// 删除档案数据字典详情
export const delArchivesDicDetList = (data) => request({
  url: '/yuyi-config-boot/api/config/arcDictData',
  method: 'delete',
  data
})

// 根据系统字典类型名称查询字典取值
export const getSysDicId = (data) => {
  return request({
    url: `/yuyi-config-boot/api/config/dictData/child?dictTypeName=${data}`
  })
}

// 根据档案字典类型名称查询字典取值
export const getArchivesDicId = (data) => {
  return request({
    url: `/yuyi-config-boot/api/config/arcDictType/child?dictTypeName=${data}`
  })
}

// 获取实体门类表字段  --  档案获取新增卡片数据字典类型名
export const getDicTypeName = (id) => {
  return request({
    url: `/yuyi-category-boot/api/metadata/categoryTableColumn/${id}`
  })
}
